package cn.youframe.sample.tablist;

import cn.youframe.frame.base.BaseCtrl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * User: Administrator
 * DateTime: 12-8-1: 下午4:54
 */
@Controller
@RequestMapping(value = "/sample")
public class TabOracleCtrl extends BaseCtrl{
    private static int DEFAULT_PAGE_SIZE=10;
    @Autowired
    private TabListService tabListService;
    @RequestMapping(value = "/TabOracleCtrl!queryLogOracle.do")
    public String queryLogOracle(HttpServletRequest request){
        Map<String,Object> paramMap=getParamMap(request);
        int totalRows =initEcSide(paramMap,request,DEFAULT_PAGE_SIZE);
        List rslist = tabListService.queryLogOracle(paramMap);
        int rsSize=(rslist==null?0:rslist.size());
        if(totalRows<0 && rsSize>0){
            setTotalRows(rslist,request,DEFAULT_PAGE_SIZE);
        }
        request.setAttribute("recordList", rslist);
        return "sample/tablist/TabOracleContent";
    }
}
